<%inherit file="/front/base/normalbase.html"/>
<%def name="center()">
<%!
import datetime
%>
%if len([c for c in coupons if c.enddate > datetime.datetime.now()]) > 0:
<div class="row">
    <div class="page-header">
        <h1>
            <a href="#sd">优惠券</a>
            <small>各种优惠券都在这里啦！</small>
        </h1>
    </div>
    <ul class="thumbnails">
        %for coupon in coupons[0:2]:
        <li class="span2">
            <p style="height:125px;"><a href="/coupons/detail/${coupon.id}.html"><img src="${coupon.picture}" class="img-polaroid"/></a></p>
            <p><span class="label label-info">商家:</span>&nbsp;<code>${h.cutlength(12)(coupon.businessuser.companyname)}</code><br/>
        </li>
        <li class="span25">
        <h4>
            <a href="/coupons/detail/${coupon.id}.html" class="brand" target="_blank">${h.cutlength(12)(coupon.name)}</a>
        </h4>
        <span class="badge badge-success">${coupon.number-len(coupon.couponrandoms)}张</span>
        <span class="badge badge-warning">${coupon.leftdays}天</span>
        <p style="height:62px;overflow:hidden;margin:10px 0 0;">${h.entertobr(coupon.shortdetail)|n}</p>
        <p><span class="label label-info">特色:</span>&nbsp;<code>${coupon.businessuser.special}</code><br/>
        </li>
        %endfor
    </ul>
</div><!--coupons-->
%endif
<div class="row">  
    <div class="page-header">
        <h1>
            <a href="#sd">热销商品</a>
            <small>亲,送货上门，货到付款哦！</small>
        </h1>                      
    </div>
    <ul class="thumbnails">
        %for product in products[0:4]:
        <li class="span23">
        <p style="height:160px;"><a href="/products/detail/${product.id}.html"><img src="${product.picture}" class="img-polaroid"/></a></p>
        <h5 style="height:38px;overflow:hidden;"><a href="/products/detail/${product.id}.html">${product.name}</a></h5>
        <span class="muted"><del>￥${product.marketprice}</del></span>
        <span class="badge badge-important">￥${product.sellprice}</span>
        </li>
        %endfor
    </ul>
    %if len(products) > 4:
    <ul class="thumbnails">
        %for product in products[4:8]:
        <li class="span23">
        <p style="height:160px;"><a href="/products/detail/${product.id}.html"><img src="${product.picture}" class="img-polaroid"/></a></p>
        <h5 style="height:38px;overflow:hidden;"><a href="/products/detail/${product.id}.html">${product.name}</a></h5>
        <span class="muted"><del>￥${product.marketprice}</del></span>
        <span class="badge badge-important">￥${product.sellprice}</span>
        </li>
        %endfor
    </ul>
    %endif
</div><!--product-->
<!--
<div class="row">
    <div class="span4 no-margin">
        <div class="page-header">
            <h1>
                <a href="#sd">跳蚤市场</a>
                <small>不用的东西来这里出售吧</small>
            </h1>
        </div>
        <ul>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
        </ul>
    </div>
    <div class="span4 offset1">
        <div class="page-header">
            <h1>
                <a href="#sd">租房信息</a>
                <small>学校附近的房子都在这里了</small>
            </h1>
        </div> 
        <ul>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
            <li><span><a href="#sdf">闲置自行车出售，给钱就卖了</a></span><span class="pull-right atn">2012-03-04</span></li>
        </ul>
    </div>
</div>--><!--info-->
</%def>


